package com.jianglin.controller;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;/*mvc的controller是一个接口*/

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@org.springframework.stereotype.Controller("/hello2")/*注解*/
public class HelloController2 implements Controller {
    @Override
    public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
        /*有返回值的,第二种方式*/
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("hm2.jsp");
        return modelAndView;
    }
}
